home *** CD-ROM | disk | FTP | other *** search
- How to add custom accelerators to menu commands
-
- To add - or change - a access key or custom accelerator key to a menu
- command find the script statement that adds the menu item and then add an '&'
- character just before the character you want to be the access key
- character in the menu name.
-
- For example to make 'D' the access character for the menu:
-
- menu.appendItem("Debug Application...",
-
- add an '&' just before the D
-
- menu.appendItem("&Debug Application...",
-
- To add a custom accelerator key add a tab escape character followed by the
- acceleator key. For example activate the Debug Application menu item using the
- the F9 key set the label to "&Debug Application...\tF9".
-
- Menu commands can be added by any script, but all the menu commands
- added by the released version of the IDE are located in onStartup scripts
- and all new menu items are added by the menu.appendItem() method.
-
- You can also change the menu item label of installed menus by using the getMenu
- method and then using setItemLabel. For example, the following script will change
- all Edit Cut menu items to use the clasic Borland IDE short cut Shift+Del.
-
- var editMenuList = getMenu("&Edit", ".*");
- if (editMenuList)
- {
- var position = editMenuList.getHeadPosition();
- while (position.valid)
- {
- var editMenu = editMenuList.getNext(position);
- editMenu.setItemLabel("Cu&t\tShift+Del",3);
- }
- }
-
- Copyright ⌐ 1997-1998 - Modelworks Software
-